<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
    />

    <title>仿制B站吃豆人轮播图</title>
    <!-- 引入字体图标库 -->
    <link rel="stylesheet" href="./ico/iconfont.css" />
    <link rel="stylesheet" href="./CSS/6-style.css" />
    <!-- 这个案例用到的是vue的语法 -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  </head>

  <body>
    <div
      class="container"
      id="app"
      @mouseover="stopAutoPlay"
      @mouseout="startAutoPlay"
    >
      <div class="img-box">
        <img :src="item.image" alt="" v-for="item in list" />
      </div>
      <div class="bottom-box" :style="{'--b-color':list[0].bottom_color}">
        <div class="l-box">
          <div class="title">{{list[active_index].title}}</div>
          <ul class="dots">
            <li
              :class="[index==active_index?'pacman':'dot',is_prev?'l':'']"
              v-for="(item,index) in list"
              @click="changeBanner(index)"
            >
              <!-- 吃豆人 -->
              <div v-if="index==active_index"></div>
              <div v-if="index==active_index"></div>
            </li>
          </ul>
        </div>
        <div class="r-box">
          <span
            class="iconfont icon-zuojiantou"
            @click="changeBanner(-1,true)"
          ></span>
          <span
            class="iconfont icon-youjiantou"
            @click="changeBanner(-1,false)"
          ></span>
        </div>
      </div>
    </div>
  </body>
</html>

<script src="./JS/6-script.js"></script>
